<? 
if ($query) {
   
              while ( $result = mysql_fetch_array($query)){
                  
                  
                  if (  ($searchFirm == '') || ( false !== mb_strpos( mb_strtolower($result['name'], 'UTF-8'), mb_strtolower($searchFirm, 'UTF-8' ) ) ) ) {
                  
                  ?>
                  			<div class="bt_dash w_vac firms">
				<table class="ab_off">
					<tr>
						<td style="width: 20%;">
							<span class="about_co"></span>
							<br />
							<img src="images/emd.png" alt="" />
						</td>
						<td style="width: 50%;">
							<p>
								<span class="sp_grey pr10">
									<b>Фирма:</b>
								</span> 
								<?echo $result['name']?> 							</p>
							<p>	
								<span class="sp_grey pr10">
									<b>Телефон:</b>
								</span>
								<?echo $result['telephone']?>							</p>
							<p>
								<span class="sp_grey pr10">
									<b>Описание:</b>
								</span>
								<?echo $result['description']?>							</p>
							<ul class="more_map">
								<li>
									<a href="<?=W_ABSPATH?>firm/<?=$result['id_firm']?>" class="more_icon">Подробнее</a>
								</li>
							</ul>
						</td>
						<td style="width: 30%;">
							<? $query1 ="SELECT count(id_vacancy) AS num FROM vacancy WHERE id_firm = '".$result['id_firm']."'"; 
                                                       
                                                       $result1 =  mysql_fetch_array(mysql_query($query1));
                                                       echo $result1['num'];
                                                       
                                                       ?> вакансий
						</td>
					</tr>
				</table>
			</div><!-- .bt_dash -->
 <?
                    } //end if
                } //end while
          } else
               echo 'no query';